﻿using Abp.Domain.Entities.Auditing;
using System;
using System.ComponentModel.DataAnnotations.Schema;

namespace Basefr.Core.Entities
{
    /// <summary>
    /// 可以创建快照的对象
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public abstract class SnapshotEntity<T> : EntityBase, IFullAudited, ISnapshot<T> where T : EntityBase
    {
        //public DateTime? LastModificationTime { get; set; }
        //public long? LastModifierUserId { get; set; }
        public DateTime? DeletionTime { get; set; }
        public long? DeleterUserId { get; set; }

        /// <summary>
        /// 是否快照
        /// </summary>
        public bool IsSnapshot { get; set; }

        /// <summary>
        /// 原对象
        /// </summary>
        public int? OriginId { get; set; }
        [ForeignKey(nameof(OriginId))]
        public T Origin { get; set; }
    }
}
